package sv.gob.mh.dgii.model;

// Generated Dec 12, 2007 1:25:05 PM by Hibernate Tools 3.2.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * EdDetalleNota generated by hbm2java
 */
@Entity
@Table(name = "ED_DETALLE_NOTA", schema = "EDADEPUDOC")
public class EdDetalleNota implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5016619575892305593L;
	private EdDetalleNotaId id;
	private TbFormulariosVersiones tbFormulariosVersiones;
	private EdNotaAbono edNotaAbono;
	private Long ndocNota;
	private Double vdetMonNota;
	private Long ndocDigit;
	private Double vdetMonDig;
	private Set<EdLoteCdt> edLoteCdts = new HashSet<EdLoteCdt>(0);

	public EdDetalleNota() {
	}

	public EdDetalleNota(EdDetalleNotaId id,
			TbFormulariosVersiones tbFormulariosVersiones,
			EdNotaAbono edNotaAbono) {
		this.id = id;
		this.tbFormulariosVersiones = tbFormulariosVersiones;
		this.edNotaAbono = edNotaAbono;
	}

	public EdDetalleNota(EdDetalleNotaId id,
			TbFormulariosVersiones tbFormulariosVersiones,
			EdNotaAbono edNotaAbono, Long ndocNota, Double vdetMonNota,
			Long ndocDigit, Double vdetMonDig, Set<EdLoteCdt> edLoteCdts) {
		this.id = id;
		this.tbFormulariosVersiones = tbFormulariosVersiones;
		this.edNotaAbono = edNotaAbono;
		this.ndocNota = ndocNota;
		this.vdetMonNota = vdetMonNota;
		this.ndocDigit = ndocDigit;
		this.vdetMonDig = vdetMonDig;
		this.edLoteCdts = edLoteCdts;
	}

	@EmbeddedId
	@AttributeOverrides( {
			@AttributeOverride(name = "nnotaAbono", column = @Column(name = "N_NOTA_ABONO", nullable = false, length = 12)),
			@AttributeOverride(name = "cformulario", column = @Column(name = "C_FORMULARIO", nullable = false, precision = 4, scale = 0)),
			@AttributeOverride(name = "cversion", column = @Column(name = "C_VERSION", nullable = false, precision = 4, scale = 0)) })
	public EdDetalleNotaId getId() {
		return this.id;
	}

	public void setId(EdDetalleNotaId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns( {
			@JoinColumn(name = "C_FORMULARIO", referencedColumnName = "C_FORMULARIO", nullable = false, insertable = false, updatable = false),
			@JoinColumn(name = "C_VERSION", referencedColumnName = "C_VERSION", nullable = false, insertable = false, updatable = false) })
	public TbFormulariosVersiones getTbFormulariosVersiones() {
		return this.tbFormulariosVersiones;
	}

	public void setTbFormulariosVersiones(
			TbFormulariosVersiones tbFormulariosVersiones) {
		this.tbFormulariosVersiones = tbFormulariosVersiones;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "N_NOTA_ABONO", nullable = false, insertable = false, updatable = false)
	public EdNotaAbono getEdNotaAbono() {
		return this.edNotaAbono;
	}

	public void setEdNotaAbono(EdNotaAbono edNotaAbono) {
		this.edNotaAbono = edNotaAbono;
	}

	@Column(name = "N_DOC_NOTA", precision = 22, scale = 0)
	public Long getNdocNota() {
		return this.ndocNota;
	}

	public void setNdocNota(Long ndocNota) {
		this.ndocNota = ndocNota;
	}

	@Column(name = "V_DET_MON_NOTA", precision = 12)
	public Double getVdetMonNota() {
		return this.vdetMonNota;
	}

	public void setVdetMonNota(Double vdetMonNota) {
		this.vdetMonNota = vdetMonNota;
	}

	@Column(name = "N_DOC_DIGIT", precision = 22, scale = 0)
	public Long getNdocDigit() {
		return this.ndocDigit;
	}

	public void setNdocDigit(Long ndocDigit) {
		this.ndocDigit = ndocDigit;
	}

	@Column(name = "V_DET_MON_DIG", precision = 12)
	public Double getVdetMonDig() {
		return this.vdetMonDig;
	}

	public void setVdetMonDig(Double vdetMonDig) {
		this.vdetMonDig = vdetMonDig;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "edDetalleNota")
	public Set<EdLoteCdt> getEdLoteCdts() {
		return this.edLoteCdts;
	}

	public void setEdLoteCdts(Set<EdLoteCdt> edLoteCdts) {
		this.edLoteCdts = edLoteCdts;
	}

}
